Command descriptions for sequential-access devices LOAD UNLOAD command
SCSI-2

10.2.1 ERASE command

The ERASE command (see table 175) causes part or all of the medium to be erased beginning at the current position on the logical unit. As used here, erased means either the medium shall be erased or a pattern shall be written on the medium that appears as a gap to the target.

Table 175 - ERASE command

===============================================================================
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=============================================================================|
| 0   |                           Operation code (19h)                        |
|-----------------------------------------------------------------------------|
| 1   |   Logical unit number    |         Reserved          | Immed |  Long  |
|-----------------------------------------------------------------------------|
| 2   |                           Reserved                                    |
|-----------------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----------------------------------------------------------------------------|
| 4   |                           Reserved                                    |
|-----------------------------------------------------------------------------|
| 5   |                           Control                                     |
===============================================================================
An immediate (Immed) bit of zero indicates that the target shall not return status until the erase operation has completed. An Immed bit of one indicates that the target shall return status as soon as the command has been validated. If CHECK CONDITION status is returned for an ERASE command with an Immed bit of one, the erase operation shall not be performed.

A long bit of one indicates that all remaining medium in the current partition shall be erased beginning at the current logical position. If the Immed bit is one, the target shall return status as soon as all buffered commands have completed execution and the command descriptor block of the ERASE command has been validated. The logical position following an ERASE command with a long bit of one is not specified by this standard.

( Some targets may reject an ERASE command with the long bit set to one if the logical unit is not at beginning-of-partition. )

A long bit of zero specifies an erase gap defined by the gap size field in the device configuration page (10.3.3.1). If the gap size is zero or the field is not supported, a device defined erase gap operation shall be performed. If the Immed bit is one, the target shall return status as soon as the command descriptor block has been validated. Erase gaps may be used in initiator controlled error recovery or update in place applications.

If the logical unit encounters early-warning during an ERASE command, and any buffered data, filemarks, or setmarks remain to be written, the target action shall be as defined for the early-warning condition of the WRITE command (10.2.14). If the long bit is zero, the erase operation shall terminate with CHECK CONDITION status and return sense data as defined for the WRITE command. Any buffered erases are not reported as part of the information field.